<extend name="Public:innerbase" />

<block name="js">

<script src="{:RES}/js/date/WdatePicker.js"></script>

</block>

<block name="content">

<div class="container-fluid">

	<ul class="nav nav-tabs wm-tabs">

		<li class="active"><a href="javascript:void(0)">兑换记录</a></li>

		<!--<li><a href="{:U('Member/xuorder')}">虚拟盘流水记录</a></li>-->
<!-- 
		<li><a href="{:U('Member/orderstats')}">流水统计</a></li> -->

	</ul>

	<div class="page-header wm-page-header">

	<form method="get" action="__SELF__" class="form-inline">
	 			<label>发货状态</label>
	 			<select name='deliverystat'>
					<if condition="$_GET['deliverystat'] eq ''">
					  	<option value ="" selected="selected">所有订单</option>
						<option value ="0">未发货</option>
						<option value ="1">已发货</option>
						<option value="-1">取消发货</option>
					<else/>
					  	<option value ="">所有订单</option>
					  	<if condition="$_GET['deliverystat'] eq 0">
						  	<option value ="0" selected="selected">未发货</option>
						<else/>
						  	<option value ="0">未发货</option>
						</if>
						<if condition="$_GET['deliverystat'] eq 1">
						  	<option value ="1" selected="selected">已发货</option>
						<else/>
						  	<option value ="1">已发货</option>
						</if>
						<if condition="$_GET['deliverystat'] eq -1">
						  	<option value="-1" selected="selected">取消发货</option>
						<else/>
						  	<option value="-1">取消发货</option>
						</if>
					</if>
					
					
	 			</select>
	 			<!-- <input name="wechat_name" type="text" value="{$_GET['wechat_name']}" class="form-control" /> -->
	 			<button class="btn btn-primary" type="submit">
	 				<span class="glyphicon glyphicon-search"></span>
	 				查询
	 			</button>
	 			</form> 

	</div>

	<TABLE class="table wm-table-bordered table-striped table-hover">

		<THEAD>

		<TR>

			<TH>订单号</TH>	
			<TH>WechatID</TH>	

			<TH>姓名</TH>

			<TH>电话</TH>

			<TH>地区</TH>
			
			<TH>详细地址</TH> 

			<TH>奖品名</TH>

			<TH>兑换时间</TH> 

			<TH>发货状态</TH> 

			<TH>发货时间</TH> 

			<TH>快递单号</TH>

			<TH>操作</TH>


		</TR>

		</THEAD>

		<TBODY>

		<volist id="list" name="list">

		<TR>

			<TD>{$list.orderid}</TD>
			<TD>{$list.open_id}</TD>

			<TD>{$list.username}</TD>

			<TD>{$list.phonenum}</TD>
			<TD>{$list.area}</TD>
			<TD>{$list.address}</TD>
			<TD>{$list.prizename}</TD>

			<TD><php>echo date('Y-m-d H:i',$list['orderupdatetime']);</php></TD>

			<TD>
				<if condition="$list.deliverystat eq 1">
					<span style="display: block;width:60px;color: green;">已发货</span>
				<else />
					<if condition="$list.deliverystat eq 0">
						<span style="display: block;width:60px;color: red;">未发货</span>
					<else />
						<span style="display: block;width:60px;">取消发货</span>
					</if>
				</if>
			</TD>

			<TD><php>echo $list['tracktime']?date('Y-m-d H:i',$list['tracktime']):'-';</php></TD>

			<TD><php>echo $list['tracknum']?$list['tracknum']:'-';</php></TD>

			<TD><a style='display: block;width: 30px;' href="{:U('Member/orderedit/')}?orderid={$list.orderid}" style='cursor:pointer;'>修改</a></TD>


			

		</form>

		</TR>

		</volist>

	  </TBODY>

	</TABLE>

	<div>{$page}</div>

</div>

</block>